function model=update_beta_1(model, data)

%global model;

N = model.N;
k = model.k;

for l=1:model.r1
 for i=1:k 
     
     temp      = reshape(model.phi_1(:,l,i),1,N)*data.dataw1(l).w;
     temp      = temp/sum(temp);
     ind       = find(temp<model.MINVALUE);
     temp(ind) = model.MINVALUE;
     temp      = temp/sum(temp);
     
     model.beta_1(l,i).beta = temp;
     
 end
end
    
    
end
